<?php
session_start();
if(!isset($_SESSION['email'])){
		header("Location: connexion.php");		
}
// On récupère dans des variables session les données du formulaire puis on passe à l'étape suivante
if(isset($_POST['prenom'])){
	$_SESSION['prenom'] = $_POST['prenom'];
	$_SESSION['nom'] = $_POST['nom'];
	$_SESSION['password'] = $_POST['password'];
	$_SESSION['genre'] = $_POST['genre'];
	$_SESSION['dateNaiss'] = $_POST['dateNaiss'];
	$_SESSION['lieuNaiss'] = $_POST['lieuNaiss'];
	die("<meta http-equiv='refresh' content=0;URL='etape2.php'>");
}
?>
<!DOCTYPE html>
<html lang="fr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Portail web dédié à la Gestion Administrative et Pédagogique du Master 2 de Recherche Système Complexe UMMISCO">
    <meta name="author" content="DIC1 Génie Info 2013-2014 / ESP Dakar">
    <meta http-equiv="Content-Language" content="fr" />
    <link rel="shortcut icon" href="../assets/ico/favicon.png">
    <!--Feuille de style suivante => Pour DatePicker-->
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
        
    <title> UMMISCO - Master 2 SysCom </title>

    <!-- Bootstrap core CSS -->
    <link href="../assets/css/bootstrap.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="../assets/css/main.css" rel="stylesheet">
    <link rel="stylesheet" href="../assets/css/icomoon.css">
    <link href="assets/css/animate-custom.css" rel="stylesheet">
    <link rel="stylesheet" href="../assets/css/bootstrap.css"/>
	<link rel="stylesheet" href="../assets/css/bootstrapValidator.min.css"/>
	<link rel="stylesheet" type="text/css" href="css/local.css" />


    
    <link href='http://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Raleway:400,300,700' rel='stylesheet' type='text/css'>
    
      <script src="../assets/js/datepicker.js"></script>
        <script src="../assets/js/jquery-ui.js"></script>
                 
            <script>
        $(function() {
        $( "#datepicker" ).datepicker({ defaultDate: new Date(1995, 1 - 1, 1), dateFormat: "yy-mm-dd"});
        });
        </script>
	    

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="assets/js/html5shiv.js"></script>
      <script src="assets/js/respond.min.js"></script>
    <![endif]-->
  </head>

  <body data-spy="scroll" data-offset="0" data-target="#navbar-main">
  
  	<div id="navbar-main">
      <!-- Fixed navbar -->
   <div class="navbar navbar-inverse navbar-fixed-top" id="header-main">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="icon icon-shield" style="font-size:30px; color:#3498db;"></span>
          </button>
          <a class="navbar-brand hidden-xs hidden-sm" href="#home"><span class="glyphicon glyphicon-home"></span></a>
        </div>
        <div class="navbar-collapse collapse">
          <ul class="nav navbar-nav">
	      	<li><a href="../index.php#home" class="smoothScroll">Accueil</a></li>
			<li> <a href="../index.php#about" class="smoothScroll"> Présentation </a></li>
			<li> <a href="../index.php#direction" class="smoothScroll"> Direction</a></li>
			<li> <a href="../index.php#recherche" class="smoothScroll"> Recherche </a></li>
			<li> <a href="../index.php#formation" class="smoothScroll"> Formation </a></li>
			<li> <a href="../index.php#pre-inscription" class="smoothScroll"> Pré-inscription</a></li>
			<li> <a href="../index.php#contact" class="smoothScroll"> Contact</a></li>
		 </ul>
        </div><!--/.nav-collapse -->
      </div>
    </div>
    </div>

  
  
		<!-- ==== HEADERWRAP ==== -->
	   <div class="container" name="pre-inscription" id="pre-inscription">
				<a name="preinscription"></a>
				<div class="row white">
				
				 <div class="panel panel-info">
			      <div class="panel-heading">
			        <h3 class="panel-title"> <h1 class="centered"> Pré-inscription </h1></h3>
			      </div>
			      <div class="panel-body" align="center">
						Suivez les différentes étapes de ce formulaires pour soumettre votre candidature.
			      </div>
			    </div>

	       <div>	       	
	       	 <nav class="navbar navbar-inverse" role="navigation">
		      <div class="container-fluid">
		        <!-- Brand and toggle get grouped for better mobile display -->
		        <div class="navbar-header">
		          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-9">
		            <span class="sr-only">Toggle navigation</span>
		            <span class="icon-bar"></span>
		            <span class="icon-bar"></span>
		            <span class="icon-bar"></span>
		          </button>
		          <a class="navbar-brand" href="#">Les différentes étapes</a>
		        </div>
		
		        <!-- Collect the nav links, forms, and other content for toggling -->
		        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-9">
		          <ul class="nav navbar-nav">
		            <li class="active"><a href="#">1. Configuer Compte</a></li>
		            <li><a>2. Vos Coordonnées</a></li>
		            <li><a>3. Votre Parcours académique</a></li>
		          	<li><a>4. Choix d'une formation</a></li>
		          	<li><a>5. Soumettre le dossier</a></li>
		          </ul>
		        </div><!-- /.navbar-collapse -->
		      </div><!-- /.container-fluid -->
		      <br />
		      <div class="progress">
		  		<div class="progress-bar progress-bar-striped active" role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 20%;">
		    		dossier complet à 20%
		  		</div>
			 </div>
		    </nav>
		    
	        <div class="row text-center">
	            <h2>Paramètres</h2>
	        </div>
	        
	        <form action="etape1.php" method="POST">
	        <div>
	            <label for="prenom" class="col-md-2">
	                Prénom:
	            </label>
	            <div class="col-md-9">
	                <input type="text" class="form-control" name="prenom" id="prenom" placeholder="Entrer votre prénom" <?php if (isset ($_SESSION['prenom'])){echo "value='".$_SESSION['prenom']."'" ;} ?> >
	            </div>
	            <div class="col-md-1">
	                <i class="fa fa-lock fa-2x"></i>
	            </div>
	        </div>        
	         <div>
	            <label for="nom" class="col-md-2">
	                Nom:
	            </label>
	            <div class="col-md-9">
	                <input type="text" class="form-control" id="nom" name="nom" placeholder="Entrer votre nom" <?php if (isset ($_SESSION['nom'])){echo "value='".$_SESSION['nom']."'" ;} ?> >
	            </div>
	            <div class="col-md-1">
	                <i class="fa fa-lock fa-2x"></i>
	            </div>
	        </div>   
	        
	        <div>
	            <label for="email" class="col-md-2">
	                Adresse email:
	            </label>
	            <div class="col-md-9">
	                <input type="email" class="form-control" name="email"  id="email" placeholder="Entrer votre email" value="<?php if (isset ($_SESSION['email'])) echo($_SESSION['email']); ?>" readonly="readonly" >
	            </div>
	             <div class="col-md-1">
	                <i class="fa fa-lock fa-2x"></i>
	            </div>
	        </div>
	        <div>
	            <label for="password" class="col-md-2">
	                Mot de passe:
	            </label>
	            <div class="col-md-9">
	                <input type="password" class="form-control" id="password" name="password" placeholder="Enter Password" <?php if (isset ($_SESSION['password'])){echo "value='".$_SESSION['password']."'" ;} ?>>
	                <p class="help-block">
	                    Min: 6 caractères (Alphanumerique seulement)
	                </p>
	            </div>
	             <div class="col-md-1">
	                <i class="fa fa-lock fa-2x"></i>
	            </div>
	        </div>
	        <div>
	            <label for="genre" class="col-md-2">
	                Genre:
	            </label>
	            <div class="col-md-10">
	                <label class="radio">
	                    <input type="radio" name="genre" id="genre" value="homme" <?php if (isset ($_SESSION['genre'])){ if ($_SESSION['genre']=='homme') echo "checked" ;} ?>>
	                    Homme
	                </label>
	                <label class="radio">
	                    <input type="radio" name="genre" id="Radio1" value="femme" <?php if (isset ($_SESSION['genre'])){ if ($_SESSION['genre']=='femme') echo "checked" ;} ?>>
	                    Femme
	                </label>
	            </div>             
	        </div>
	        
	         <div>
	            <label for="dateNaiss" class="col-md-2">
	                Date de naissance:
	            </label>
	            <div class="col-md-9">
	                <input type="text" id="datepicker" class="form-control" name="dateNaiss" placeholder="Date de naissance sous ce format AAAA-MM-JJ"
                        <?php if (isset ($_SESSION['dateNaiss'])){echo "value='".$_SESSION['dateNaiss']."'" ;} ?>>
	            </div>
	        </div>

	        <div>
	            <label for="lieuNaiss" class="col-md-2">
	                Lieu de naissance:
	            </label>
	            <div class="col-md-9">
	                <input type="text" class="form-control" id="lieuNaiss" name="lieuNaiss" placeholder="Entrer votre lieu de naissance" <?php if (isset ($_SESSION['lieuNaiss'])){echo "value='".$_SESSION['lieuNaiss']."'" ;} ?> >
	            </div>
	        </div>
	        
	        <div class="row">
	            <div class="col-md-2">
	            </div>
	            <div class="col-md-10">
	            	 <br />
	                <button type="submit" class="btn btn-info btn-lg">
	                    Suivant
	                </button>
	            </div>
	        </div>
	       </form>
	    </div> 
	    
	  </div>
                	     
			</div>
		</div>

		<div id="footerwrap">
			<div class="container">
				<h4>Created by <a href="http://code.google.com/p/master2syscom" target="_blank">DIC1 Info ESP</a> - Copyright 2014</h4>
			</div>
		</div>

    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
		
	<script src="assets/js/jquery.min.js"></script>
	<script type="text/javascript" src="../assets/js/modernizr.custom.js"></script>
	<script type="text/javascript" src="../assets/js/jquery.min.js"></script>
	<script type="text/javascript" src="../assets/js/bootstrapValidator.min.js"></script>
	
	<script type="text/javascript" src="../assets/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="../assets/js/retina.js"></script>
	<script type="text/javascript" src="../assets/js/jquery.easing.1.3.js"></script>
    <script type="text/javascript" src="../assets/js/smoothscroll.js"></script>
	<script type="text/javascript" src="../assets/js/jquery-func.js"></script>
	<script>	
		$(document).ready(function() {
	    $('.col-lg-12').bootstrapValidator({
	        message: 'This value is not valid',
	        feedbackIcons: {
	            valid: 'glyphicon glyphicon-ok',
	            invalid: 'glyphicon glyphicon-remove',
	            validating: 'glyphicon glyphicon-refresh'
	        },
	        fields: {
	            email: {
	                validators: {
	                    notEmpty: {
	                        message: 'The email is required and cannot be empty'
	                    },
	                    emailAddress: {
	                        message: 'The input is not a valid email address'
	                    }
	                }
	            }
	        }
	    });
	});
</script>
  </body>
</html>
